package com.serialPort;

import com.serialPort.web.controller.SerialPortController;
import com.serialPort.web.service.SerialPortService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.io.IOException;

/**
 * 启动程序
 *
 */

@EnableScheduling
@SpringBootApplication
@EnableAsync
public class Application
{

    @Autowired
    SerialPortService serialPortService;

    private static final Logger logger = LoggerFactory.getLogger(Application.class);
    public static void main(String[] args) throws IOException {
        logger.info("启动成功");
        SpringApplication.run(Application.class, args);
        System.out.println("项目启动成功!");

        SerialPortController serialPortController = new SerialPortController();
        serialPortController.run();
    }
}
